package scaladuct;

/**
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: 12.4.11
 * Time: 15:34
 * To change this template use File | Settings | File Templates.
 */
public class RefInfoFactory {

    public static RefInfo newInstance(Ref ref, BeanInfo beanInfo, String propertyName) {
        if (ref == null) {
            return null;
        }else if (ref.motherArg() == -1) {
            return new BeanInfoRefInfo(beanInfo, propertyName);
        } else {
            return PhaseMethodRefInfo.newInstance(ref);
        }
    }

}
